<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>对一个固定高度和盒子进行监听</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <style>

    </style>
</head>

<body>
<!--菜单容器-->
<div id="selector">
    <nav  class=" navbar navbar-default navbar-fixed-top" >
        <ul class="nav navbar-nav ">
            <li class="active"><a href="#name1">@fat</a></li>
            <li><a href="#name2">@mdo</a></li>
            <li><a href="#name3">one</a></li>
            <li><a href="#name4">two</a></li>

        </ul>
    </nav>
</div>
<!--滚动监听区域-->

<div data-offset="10" data-target="#selector" data-spy="scroll"
     style="height: 300px;overflow: auto;margin: 60px 10px;border:  1px solid #CCCCCC; padding: 0 20px">

    <h4 id="name1">@fat</h4>
    <p>
        Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi
        before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim
        keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon
        irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you
        probably haven't heard of them et cardigan trust fund culpa biodiesel wes
        anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh
        artisan ullamco consequat.
        Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi
        before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim
        keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon
        irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you
        probably haven't heard of them et cardigan trust fund culpa biodiesel wes
        anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh
        artisan ullamco consequat.
    </p>
    <h4 id="name2">@mdo</h4>
    <p>
        Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.
        Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi,
        ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis
        non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic
        exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar
        deserunt.
        Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.
        Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi,
        ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis
        non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic
        exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar
        deserunt.
    </p>
    <br>
    <h4 id="name3"> one</h4>
    <p>
        Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea.
        Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore
        single-origin coffee in magna veniam. High life id vinyl, echo park consequat
        quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi
        DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny
        pack iphone.
    </p>
    <h4 id="name4"> two</h4>
    <p>
        In incididunt echo park, officia deserunt mcsweeney's proident master cleanse
        thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1
        biodiesel laborum craft beer. Single-origin coffee wayfarers irure four
        loko, cupidatat terry richardson master cleanse. Assumenda you probably
        haven't heard of them art party fanny pack, tattooed nulla cardigan tempor
        ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable.
        Elit wolf voluptate, lo-fi ea portland before they sold out four loko.
        Locavore enim nostrud mlkshk brooklyn nesciunt.
    </p>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
</div>


<script src="js/jquery-1.12.4.js"></script>
<script src='js/bootstrap.min.js'></script>
<script>


</script>
</body>
</html>